import React from 'react'
import { withRouter, Switch, Redirect } from 'react-router-dom'
import LoadableComponent from '../utils/LoadableComponent'
import PrivateRoute from '../components/PrivateRoute/index'

const  page1 = LoadableComponent(()=>import('../views/page1/index'))  //home

//关于
const About = LoadableComponent(()=>import('../views/About/index'))


class ContentMain extends React.Component {
  render () {
    return (
      <div style={{padding: 16, position: 'relative'}}>
        <Switch>
          <PrivateRoute exact path='/home' component={page1}/>
          <PrivateRoute exact path='/home/about' component={About}/>

          <Redirect exact from='/' to='/home'/>
        </Switch>
      </div>
    )
  }
}

export default withRouter(ContentMain)